import socket
sk = socket.socket()
sk.connect(("127.0.0.1",8000))

while True:
    inp = input("请输入想说的话")
    sk.send(inp.encode())
    msg = sk.recv(1024).decode()
    print(msg)
    if msg.upper() == "Q":
        break
sk.close()